package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.StoreInoutDao;
import cn.topevery.garden.entity.po.StoreInout;
import cn.topevery.garden.entity.query.StoreInoutQuery;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author code-generate
 * @date 2021-08-30
 */
@Service
public class StoreInoutLogic extends BaseLogic<StoreInout> {
    @Autowired
    StoreInoutDao storeInoutDao;

    @Override
    public BaseEntityDao<StoreInout, Integer> getDao() {
        return storeInoutDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<StoreInout> listPage(StoreInoutQuery query) {
        return storeInoutDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        storeInoutDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param storeInout 实体
     */
    public boolean saveOrUpdate(String userId, StoreInout storeInout){
        storeInoutDao.saveOrUpdate(userId,storeInout);
        return true;
    }

    /**
     * 描述 检查是否存在.
     *
     * @param fieldName the field name
     * @param value     the value
     * @return the boolean
     * @author wenzhao.lin
     * @created 2021 -08-30 10:37:36 Is exit boolean.
     */
    public boolean isExit(String fieldName, String value){
        return storeInoutDao.isExit(fieldName, value);
    }
}
